package com.zzy.furns.service.impl;

import com.zzy.furns.dao.MemberDAO;
import com.zzy.furns.dao.impl.MemberDAOImpl;
import com.zzy.furns.domain.Member;
import com.zzy.furns.service.MemberService;

public class MemberServiceImpl implements MemberService {

    private MemberDAO memberDAO = new MemberDAOImpl();
    @Override
    public boolean registerMember(Member member) {
        return memberDAO.saveMember(member) == 1? true : false;
    }

    @Override
    public boolean isExistsUsername(String username) {
        Member member = memberDAO.queryMemberByUsername(username);
        return member == null? false : true;
    }

    @Override
    public Member login(String username,String password) {
        return memberDAO.queryMemberByUsernameAndPassword(username,password);
    }
}
